Skip to content

Fix type of Tasty.Type.TypeSelect.prefix #4682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2018

Conversation

nicolasstucki
Copy link
Contributor

Previously we did not support type trees as prefixes

Previously we did not support type trees as prefixes
To make it easier to consume the API.
@liufengyun
Copy link
Contributor

tests/run/tasty-extractors-2 failed.

@nicolasstucki
Copy link
Contributor Author

tests/run/tasty-extractors-2 should be fixed now

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, LGTM


object TypeSelect extends TypeSelectExtractor {
def unapply(x: TypeTree)(implicit ctx: Context): Option[(TypeTree, String)] = x match {
case x: tpd.Select @unchecked if x.isType && x.qualifier.isType => Some(x.qualifier, x.name.toString)
case _ => None
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the name a little misleading, what about TypeProject? Then we can keep using TypeSelect as before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users would write the extractors as Type.TypeSelect(_, _) and Type.TermSelect(_, _). We should have a pass on all names later to make sure all names are good.

@nicolasstucki nicolasstucki merged commit 8b2500e into scala:master Jun 19, 2018
@liufengyun liufengyun deleted the fix-typeselect branch June 19, 2018 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants